function f= computey(theta2,sj,v,x2,p,QI,ind_market,A1,deltaold,sales_tax) 

delta=zeros(size(ind_market));
marg=zeros(size(ind_market));

for i=1:max(ind_market)
    temp=find(ind_market==i);
    delta(temp)=contraction(theta2,sj(temp),v,x2(temp,:),p(temp,:) ...
        ,QI(temp,:),ind_market(temp,:),deltaold(temp,:));% run "contraction" script
end

f=delta; 

